package com.lixinlei.springboot_servlet.servlet.servletregistrationbean;

import org.springframework.boot.web.servlet.ServletRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class ServletRegistrationBeanConfig {

    @Bean
    public ServletRegistrationBean registerServlet() {
        ServletRegistrationBean servletRegistrationBean = new ServletRegistrationBean(
                new RegistrationBeanServlet(), "/registrationBeanServlet");
        servletRegistrationBean.addInitParameter("className", "RegistrationBeanServletConfig");
        return servletRegistrationBean;
    }

}
